package com.mercycrazy.recruit.user;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 手机号和验证码
 *
 * @author <a href="mailto:1443424326@qq.com">mercycrazy</a>
 * @since 2023-01-13
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Schema(description = "手机号和验证码")
public class MobileAndCode implements Serializable {

    @Schema(description = "手机号")
    @NotBlank(message = "mobile不能为空")
    @Pattern(regexp = "^1\\d{10}$", message = "mobile内容不正确")
    private String mobile;

    @Schema(description = "验证码")
    private String code;
}
